package com.example.controller;

import com.example.controller.utils.A;
import com.example.domain.SMSCode;
import com.example.service.SMSCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sms")
public class SMSCodeController {

    @Autowired
    private SMSCodeService smsCodeService;

    @GetMapping("{tele}")
    public String getCode(@PathVariable String tele) {
        return smsCodeService.sendCodeToSMS(tele);
    }

    @PostMapping
    public A checkCode(SMSCode smsCode) {
        return smsCodeService.checkCode(smsCode);
    }
}
